const baseUrl = 'http://localhost:8082'

export const request = (option) => {
	return new Promise((resovle,rejecet)=>{
		uni.request({
			url:baseUrl + option.url,
			method:option.method || "GET",
			data:option.data || {},
			success: (res) => {
				if(res.data.status !== 0 ){
					return uni.showToast({
						title:"获取数据失败"
					})
				}
				resovle(res)
			},
			fail: (err) => {
				uni.showToast({
					title:"请求接口失败"
				})
				rejecet(err)
			}
		})
	})
}